import request from '@/utils/request'

// 获取缴费列表
export function fetchEquipments(marketId, type, page, perPage) {
    const data = {marketId, type, page, perPage}
    return request({
      url: 'api/v2/backend/equipment/index',
      method: 'post',
      data
    })
  }

export function addNewEquipment(marketId, posId, equipmentType, equipmentName, equipmentMac, type) {
  const data = {marketId, posId, equipmentType, equipmentName, equipmentMac, type}
  console.log(data)
  return request({
    url: 'api/v2/backend/equipment/add',
    method: 'post',
    data
  })
}

export function editEquipment(equipmentId, marketId, posId, equipmentType, equipmentName, equipmentMac, type) {
  const data = {equipmentId, marketId, posId, equipmentType, equipmentName, equipmentMac, type}
  return request({
    url: 'api/v2/backend/equipment/edit',
    method: 'post',
    data
  })
}

export function deleteEquipment(equipmentId, marketId, type) {
  const data = {equipmentId, marketId, type}
  return request({
    url: 'api/v2/backend/equipment/del',
    method: 'post',
    data
  })
}
